<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>卓越管理平台</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="shortcut icon" href="/static/images/favicon.ico"/>
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/login.css" media="all">
    <link rel="icon" type="image/x-icon" href="/images/favicon.ico"/>
    <style>
        /* 覆盖原框架样式 */
        .layui-elem-quote {
            background-color: inherit !important;
        }

        .layui-input, .layui-select, .layui-textarea {
            background-color: inherit;
            padding-left: 30px;
        }
    </style>
    <!-- Jquery Js -->
    <script src="/common/jquery-2.1.1.js"></script>
    <script src="/common/jquery.json-2.4.js"></script>
    <script type="text/javascript" src="/common/jqarticle/jparticle.min.js"></script>
    <script type="text/javascript" src="/common/zylVerificationCode/zylVerificationCode.js"></script>

</head>
<body>
<!-- Head -->
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md12">
            <!--	<blockquote class="layui-elem-quote">湖南信息学院—道德银行管理系统</blockquote>-->
            <img src="/images/logo.png" height="79" width="403"
                 style="margin-top: 25px;margin-left: 20px;margin-bottom: 10px"/>
        </div>
    </div>
</div>
<!-- Head End 111-->

<!-- Carousel -->
<div class="layui-row">
    <div class="layui-col-sm12 layui-col-md12">
        <div class="layui-carousel zyl_login_height" id="zyllogin" lay-filter="zyllogin">
            <div carousel-item="">
                <div>
                    <div class="zyl_login_cont"></div>
                </div>
                <div>
                    <div class="background">
                        <span></span><span></span><span></span>
                        <span></span><span></span><span></span>
                        <span></span><span></span><span></span>
                        <span></span><span></span><span></span>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Carousel End -->

<!-- Footer -->
<div class="layui-row">
    <div class="layui-col-sm12 layui-col-md12 zyl_center" style="margin-top: 15px">
        © 2021 - 湖南信息学院(信息技术研究院)
    </div>
</div>
<!-- Footer End -->


<!-- LoginForm -->
<div class="zyl_lofo_main">
    <fieldset class="layui-elem-field layui-field-title zyl_mar_02">
        <legend>欢迎登陆 - 元旦抽奖平台</legend>
    </fieldset>
    <div class="layui-row layui-col-space15">
        <form class="layui-form zyl_pad_01" id="f_staff">
            <div class="layui-col-sm12 layui-col-md12">
                <div class="layui-form-item">
                    <input type="text" name="loginname" id="user-login-username" lay-verify="required|userName"
                           autocomplete="off" placeholder="账号" class="layui-input" value="430723200004133417">
                    <i class="layui-icon layui-icon-username zyl_lofo_icon"></i>
                </div>
            </div>
            <div class="layui-col-sm12 layui-col-md12">
                <div class="layui-form-item">
                    <input type="password" name="pwd" id="user-login-password" lay-verify="required|pass"
                           autocomplete="off" placeholder="密码" class="layui-input" value="88888888">
                    <i class="layui-icon layui-icon-password zyl_lofo_icon"></i>
                </div>
            </div>
            <div class="layui-col-sm12 layui-col-md12">
                <div class="layui-row">
                    <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
                        <div class="layui-form-item">
                            <input type="text" name="code" id="user-login-vercode" lay-verify="required|vercodes"
                                   autocomplete="off" placeholder="验证码" class="layui-input" maxlength="4">
                            <i class="layui-icon layui-icon-vercode zyl_lofo_icon"></i>
                        </div>
                    </div>
                    <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
                        <div class="zyl_lofo_vercode zylVerCode" onclick="zylVerCode()" id="code"></div>
                    </div>
                </div>
            </div>
            <div class="layui-col-sm12 layui-col-md12" style="margin-top: 10px">
                <button class="layui-btn layui-btn-fluid" lay-submit="" id="user-login-submit"
                        lay-filter="user-login-submit">立即登录
                </button>
            </div>
        </form>
    </div>
</div>
<!-- LoginForm End -->

<script type="text/javascript" src="/plugins/layui/layui.js"></script>
<script>
    layui.config({
        base: '/plugins/module/'
    });
    layui.use(['carousel', 'layer', 'table', 'cstmodules', 'form', 'jquery'], function () {
        var carousel = layui.carousel
            , form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            mymod = layui.cstmodules;
        var value = document.location.href;
        if (value.indexOf("msg") != -1) {
            layer.msg("您已经在其他地方登录，如何不是本人操作，账号涉嫌被盗请修改密码");
        }
        //自定义验证规则
        form.verify({
            'userName': function (value) {
                if (value.length < 5) {
                    return '账号至少得5个字符';
                }
            }
            /*  , 'pass': [/^[\S]{6,12}$/, '密码必须6到12位，且不能出现空格'],*/
            , 'vercodes': function (value) {
                //获取验证码
                var zylVerCode = $(".zylVerCode").html();
                if (value != zylVerCode) {
                    return '验证码错误（区分大小写）';
                }
            }
        });

        //监听提交
        form.on("submit(user-login-submit)", function (data) {
            $(this).text("登录中...").attr("disabled", "disabled").addClass("layui-disabled");
            var jsonObj = mymod.serializeJsonObj("f_staff");
            var data = mymod.callBackMethod('/sys/toLogin', "post", jsonObj);
            // 业务层验证成功
            if (data != null && data.code == 1) {
                //处理ie页面不跳转问题
                window.event.returnValue = false;
                if (window.event.preventDefault) {
                    window.event.preventDefault();
                }
                window.location.href = "/sys/main";
                /* window.location.href="/_view/main/main.html";*/
                return;
            } else {
                updateCaptcha();
                $(this).text("登入").removeAttr("disabled").removeClass("layui-disabled");
                $("#user-login-username").val("");
                $("#user-login-password").val("");
                layer.msg(data.info);
                return false;

            }
            return false;
        });

        function updateCaptcha() {
            $("#user-login-vercode").val("");
            $("#code").click();
        }


        //设置轮播主体高度
        var zyl_login_height = $(window).height() / 1.22;
        var zyl_car_height = $(".zyl_login_height").css("cssText", "height:" + zyl_login_height + "px!important");


        //Login轮播主体
        carousel.render({
            elem: '#zyllogin'//指向容器选择器
            , width: '100%' //设置容器宽度
            , height: 'zyl_car_height'
            , arrow: 'always' //始终显示箭头
            , anim: 'fade' //切换动画方式
            , autoplay: true //是否自动切换false true
            , arrow: 'hover' //切换箭头默认显示状态||不显示：none||悬停显示：hover||始终显示：always
            , indicator: 'none' //指示器位置||外部：outside||内部：inside||不显示：none
            , interval: '5000' //自动切换时间:单位：ms（毫秒）
        });

        //监听轮播--案例暂未使用
        carousel.on('change(zyllogin)', function (obj) {
            var loginCarousel = obj.index;
        });

        //粒子线条
        $(".zyl_login_cont").jParticle({
            background: "rgba(0,0,0,0)",//背景颜色
            color: "#fff",//粒子和连线的颜色
            particlesNumber: 100,//粒子数量
            //disableLinks:true,//禁止粒子间连线
            //disableMouse:true,//禁止粒子间连线(鼠标)
            particle: {
                minSize: 1,//最小粒子
                maxSize: 3,//最大粒子
                speed: 30,//粒子的动画速度
            }
        });
    });
    if (window != top) {
        top.location.href = "/sys/toLogin";
    }
</script>
</body>
</html>
